package com.youth.entity.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.youth.result.StatusEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName Commodity
 * @Description: TODO 商品信息持久化对象
 * @Author yjwu
 * @Date 2019/10/21 21:11
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Component
public class Commodity implements Serializable, Cloneable {
    private static final Long serialVersionUID = 1L;

    private int id;
    //    编号
    private String code;
    //    名称
    private String name;
    //    商品类型三级id
    private int typeThreeId;
    //    标题
    private String headline;
    //    产地id
    private int placeAreaId;
    //    是否是热门商品
    @Builder.Default
    private int doHot = 0;
    //    搜索关键词
    private String keywords;
    //    价格
    private double price;
    //库存数量
    private int storageNumber;
    //已售数量
    @Builder.Default
    private int soldNumber = 0;
    //商品简介
    private String description;
    //商品备注
    private String remark;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    @Builder.Default
    private int status = StatusEnum.INUSE.getStatus();

    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
